Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Aldotd12/bot_whatsapp/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Before relying on the automated schedule, it’s important to test your bot configuration. This guide covers manual testing and troubleshooting common problems.Manual Testing with workflow_dispatch
The workflow includesworkflow_dispatch which allows manual execution:
.github/workflows/main.yml
Running Manually on GitHub
Navigate to Actions
- Go to your GitHub repository
- Click the Actions tab at the top
- You’ll see a list of workflows on the left sidebar
Run Workflow
- Click the Run workflow dropdown button (top right)
- Select the branch (usually
mainormaster) - Click the green Run workflow button
The workflow will start immediately and typically completes in 10-20 seconds.
Expected Output
A successful run shows:Local Testing
For faster iteration, test the bot locally before pushing to GitHub:Setup Local Environment
Set Environment Variables
Create a
.env file or export variables:- Linux/Mac
- Windows (CMD)
- Windows (PowerShell)
Testing Different Time Conditions
Since the message depends on UTC hour, you can temporarily modify the logic for testing:bot.py
Remember to revert these changes before committing to GitHub.
Troubleshooting Common Issues
Issue: 401 Unauthorized
Symptoms:Check TOKEN Secret
- Go to repository Settings > Secrets and variables > Actions
- Verify
TOKENsecret exists and is not expired - Update the token if needed from your UltraMsg dashboard
Verify Instance ID
The
INSTANCE_ID must match your active UltraMsg instance:- Log in to UltraMsg dashboard
- Check your instance ID (format:
instance12345) - Update the
INSTANCE_IDsecret if it’s incorrect
Issue: 404 Not Found
Symptoms:Verify Group ID Format
WhatsApp group IDs must follow the format:
- Must include country code (e.g.,
52for Mexico) - Must end with
@g.usfor groups - Must include the group unique identifier after the dash
Issue: Workflow Not Running on Schedule
Symptoms:- Workflow doesn’t execute at scheduled times
- No runs appear in Actions tab
Check Workflow File Location
Ensure the workflow file is at:The
.github/workflows/ directory must be at the root of your repository.Verify YAML Syntax
Invalid YAML prevents the workflow from running:
- Go to Actions tab
- Look for syntax error messages
- Use a YAML validator to check your file
Check Repository Activity
GitHub may disable scheduled workflows for inactive repositories:
- Make a commit to re-enable workflows
- Ensure the repository isn’t archived
- Verify workflows are enabled in Settings > Actions > General
Issue: Wrong Message Sent
Symptoms:- “Salida” message sent in the morning
- “Entrada” message sent in the evening
Check Time Threshold Logic
The condition at
bot.py:13 determines the message:- If UTC hour < 18 → “Entrada”
- If UTC hour ≥ 18 → “Salida”
Verify Schedule Times
Check your cron schedule matches your timezone:For CST (UTC-6):
15:00 UTC=9:00 AM CST(before 18:00 UTC ✓)21:00 UTC=3:00 PM CST(after 18:00 UTC ✓)
Issue: Environment Variables Not Found
Symptoms:Verify Secret Names
In Secret names are case-sensitive and must match exactly.
.github/workflows/main.yml, check the environment variable mapping:Confirm Secrets Exist
- Go to Settings > Secrets and variables > Actions
- Verify all three secrets are listed
- Re-add any missing secrets
Debugging Tips
Add Debug Output
Add print statements to understand what’s happening:Test UltraMsg API Directly
Test your credentials with curl:Check GitHub Actions Logs
Detailed logs are available for each step:- Go to Actions tab
- Click on a workflow run
- Click on the run-bot job
- Each step can be expanded to see full output
- Look for error messages in red
Getting Help
If you’re still having issues:- Check the UltraMsg API documentation
- Verify your UltraMsg instance is active and connected
- Review the GitHub Actions logs for error details
- Test locally with debug output enabled